<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>卡密生成</title>
<load href='__PUBLIC__/Css/style.css' />
<load href="__PUBLIC__/Js/jquery-1.4.min.js" />
<load href="__PUBLIC__/Js/jquery.checkform.js" />

<script type="text/javascript">
	var _PUBLIC_ = '__PUBLIC__';
	 function tipname(namestr){ 
		return "tip_" + namestr.replace(/([a-zA-Z0-9])/g,"-$1");
	 }
	jQuery(function(){
		jQuery("#form1").valid([
			{ name:"num1",type:"int",simple:"生成数量1"},
			{ name:"num2",type:"int",simple:"生成数量2"},
			{ name:"num3",type:"int",simple:"生成数量3"},
			{ name:"num4",type:"int",simple:"生成数量4"},
		]);
	})
	function addCards(){
		trId = jQuery("#cardForm>tbody>tr:last").attr("id");
		if(trId=="8"){
			alert("最多只能添加4条信息！");
			return;
		}
		trIdOne = Number(trId)+1;
		trIdTwo = trIdOne+1;
		index = Number(trIdTwo)/2;
		str = "<tr id = '"+trIdOne+"'>";
		str += "<td class='tRight' width='100px'>充值卡额度：</td>";
		str += "<td class='tLeft'>";
		str += "	<select name='amount"+index+"'>";
		str += "	    <option value='10' <eq name='vo.sys_type' value='10'> selected</eq>>10</option>";
		str += "	    <option value='20' <eq name='vo.sys_type' value='20'> selected</eq>>20</option>";
		str += "	    <option value='50' <eq name='vo.sys_type' value='50'> selected</eq>>50</option>";
		str += "	    <option value='100' <eq name='vo.sys_type' value='100'> selected</eq>>100</option>";
        str += "	    <option value='500' <eq name='vo.sys_type' value='500'> selected</eq>>500</option>";
        str += "	    <option value='1000' <eq name='vo.sys_type' value='1000'> selected</eq>>1000</option>";
		str += "	</select>&nbsp;&nbsp;点";
		str += "</td></tr>";
		jQuery('#cardForm').append(str);
		str = "<tr id = '"+trIdTwo+"'>";
		str += "<td class='tRight'>生成数量：</td>";
		str += "<td class='tLeft' ><input type='text' class='huge bLeftRequire' name='num"+index+"' value='{$vo.password}'/></td>";
		str +="</tr>"
		jQuery('#cardForm').append(str);

		jQuery("#form1").valid([
  			{ name:"num1",type:"int",simple:"生成数量1"},
  			{ name:"num2",type:"int",simple:"生成数量2"},
  			{ name:"num3",type:"int",simple:"生成数量3"},
  			{ name:"num4",type:"int",simple:"生成数量4"},
  		]);
				
	}

	function delCards(){ 
		trId = $("#cardForm>tbody>tr:last").attr("id");
		if(trId=="2"){
			alert("不能全部删除！");
			return;
		} 
		$('#'+trId).remove(); 
		$('#'+(Number(trId)-1)).remove(); 
	} 

	
</script>
<load href="__PUBLIC__/Js/Load.js" />
</head>
<body>
<div id="main" class="main" >
<div class="content">
<div class="title" style="background:url(__PUBLIC__/Images/tab_05.gif);"><div style="line-height:30px;height:30px;float:left"><img src="__PUBLIC__/Images/tb.gif" /></div><div style="float:left;margin-left:10px;"><span>你当前的位置：</span></div><span style="font-weight:normal;">[管理员添加]</span><div style="float:right;margin-right:30px;"><a href="__URL__"><img src="__PUBLIC__/Images/publish_g.png"/>&nbsp;&nbsp;返回列表</a></div></div>
<div id="result" class="result none"></div>
<form method='post' id="form1" name="form1" action="__URL__/createCards"  enctype="multipart/form-data" >
<div class="errmsg">{$errmsg}</div>
<table cellpadding=3 cellspacing=3 id="cardForm" style="margin-top:20px;margin-left:200px;" >
<tr id="1">
	<td class="tRight" width="100px">充值卡额度：   </td>
	<td class="tLeft" >
		<select name="amount1">
		    <option value="10" <eq name="vo.sys_type" value="0"> selected</eq>>10</option>
		    <option value="20" <eq name="vo.sys_type" value="1"> selected</eq>>20</option>
		    <option value="50" <eq name="vo.sys_type" value="1"> selected</eq>>50</option>
		    <option value="100" <eq name="vo.sys_type" value="1"> selected</eq>>100</option>
            <option value="500" <eq name="vo.sys_type" value="1"> selected</eq>>500</option>
            <option value="1000" <eq name="vo.sys_type" value="1"> selected</eq>>1000</option>
		</select>&nbsp;&nbsp;点&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="javascript:addCards();"><span>追加</span></a>
		<a href="javascript:delCards();"><span>删除</span></a>
	</td>
</tr>
<tr id="2">
	<td class="tRight">生成数量：</td>
	<td class="tLeft" ><input type="text" class="huge bLeftRequire" name="num1" value="{$vo.password}"/></td>
</tr>
</table>
<div style="width:85%;text-align:center;margin:10px">
	<input type="submit" value="生 成"  class="button small"/>
</div>
</form>
</div>
</div>
</body>
